//
//  THStudentNameTableViewCell.m
//  Teacher-Help
//
//  Created by Taro on 15/10/26.
//  Copyright © 2015年 Taro. All rights reserved.
//
#define cellH self.frame.size.height
#import "THStudentNameTableViewCell.h"


@implementation THStudentNameTableViewCell

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
//        UILabel *name = [[UILabel alloc] init];
//        name.frame = CGRectMake(0, 0, screenW, 10);
//        name.backgroundColor = [UIColor redColor];
//        [self.contentView addSubview:name];
        UIScrollView *scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, screenW, cellH)];
        scroll.bounces = NO;
        scroll.contentSize = CGSizeMake(screenW + 200, self.frame.size.height);
//        scroll.backgroundColor = XColor(64, 185, 216, 1);
        scroll.pagingEnabled = YES;
        scroll.showsHorizontalScrollIndicator = NO;
        UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(screenW-100, 0, 100, cellH)];
        btn.backgroundColor = [UIColor grayColor];
        [btn setTitle:@"缺席" forState:UIControlStateNormal];
        [scroll addSubview:btn];
        
        UIButton *btn1 = [[UIButton alloc] initWithFrame:CGRectMake(screenW, 0, 100, cellH)];
        UIButton *btn2 = [[UIButton alloc] initWithFrame:CGRectMake(screenW+100, 0, 100, cellH)];
        [btn1 setTitle:@"请假" forState:UIControlStateNormal];
        [btn2 setTitle:@"迟到" forState:UIControlStateNormal];
        btn1.backgroundColor = [UIColor redColor];
        btn2.backgroundColor = [UIColor blackColor];
        [scroll addSubview:btn1];
        [scroll addSubview:btn2];
        [self.contentView addSubview:scroll];
        _scroll = scroll;
        
        
        
    }
    return self;
}

//-(void)setSelected:(BOOL)selected{
//    [_scroll setContentOffset:CGPointMake(screenW, 0) animated:YES];
//}


@end
